<?php

	$user_result = mysql_query("SELECT * FROM users WHERE username='{$_SESSION['username']}'");
	
	$user_id = mysql_result($user_result, 0, "id");
	$hospital_id = mysql_result(mysql_query("SELECT id FROM hospitals WHERE owner_id=$user_id"), 0);
	$first_name = mysql_result($user_result, 0, "first_name");
	$last_name = mysql_result($user_result, 0, "last_name");
	$cash = mysql_result($user_result, 0, "cash");
	
	$numrooms = mysql_num_rows(mysql_query("SELECT id FROM rooms WHERE hospital_id=$hospital_id"));
	$patients = $numrooms * 10;

	echo "<fieldset>";
	echo "<legend><b>{$_SESSION['username']}'s Hospital<br />Dr. $first_name $last_name, M.D.</b></legend><br />";
	echo "<b><u>Overview</u></b><ul>";
	echo "<li><u>Cash Balance:</u> \$$cash</li>";
	echo "<li><u>Patients/day:</u> $patients</li>";
	echo "</ul>";
	echo "<br /></fieldset>";

?>